<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位</title>
    <style>
        .box1{
            height: 350px;
            background-color: aqua;
        }
        .box-normal{
            width: 100px;
            height: 100px;
            background-color: purple;
        }
        .box-relative{
            width: 100px;
            height: 100px;
            background-color: pink;
            position: relative;
            left: 120px;
            top: 40px;
        }
        .box2{
            width: 100px;
            height: 350px;
            background-color: yellow;
            margin-bottom: 300px;
        }
        .box-absolute{
            width: 100px;
            height: 100px;
            background-color: yellowgreen;
          position: absolute;
          left: 120px;
        }
        /* 固定在流量器位置 */
        .box-fixed{
            width: 100px;
            height: 100px;
            background-color: red;
          position: fixed;
        }
    </style>
</head>
<body>
    <h1>相对定位</h1>
    <div class="box1">
        <div class="box-normal"></div>
        <div class="box-relative"></div>
        <div class="box-normal"></div>
    </div>
    
    <h1>绝对定位</h1>
    <div class="box2">
        <div class="box-normal"></div>
        <div class="box-absolute"></div>
        <div class="box-normal"></div>
    </div>
    <h1>固定定位</h1>
    <div class="box-fixed"></div>
</body>
</html>